package cn.felord.security.autoconfigure;

import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter;
import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter;

/**
 * The enum Ant path patterns.
 *
 * @author felord.cn
 * @since 2021 /8/7 10:45
 */
public enum LoginAntPathPatterns {

    /**
     * Matched login ant path patterns.
     */
    MATCHED("/login/*"),
    /**
     * Oauth 2 login ant path patterns.
     */
    OAUTH2(OAuth2LoginAuthenticationFilter.DEFAULT_FILTER_PROCESSES_URI),
    /**
     * Oauth 2 redirect login ant path patterns.
     */
    OAUTH2_REDIRECT(OAuth2AuthorizationRequestRedirectFilter.DEFAULT_AUTHORIZATION_REQUEST_BASE_URI+"/*"),
    /**
     * Normal login ant path patterns.
     */
    NORMAL("/login"),
    /**
     * Captcha login ant path patterns.
     */
    CAPTCHA("/login/captcha"),
    /**
     * Wechat miniapp ant path patterns.
     */
    WECHAT_MINIAPP("/login/miniapp/wechat"),
    /**
     * Wechat miniapp pre login ant path patterns.
     */
    WECHAT_MINIAPP_SESSION("/login/session/wechat"),
    /**
     * Douyin miniapp login ant path patterns.
     */
    DOUYIN_MINIAPP("/login/miniapp/douyin"),
    /**
     * Douyin miniapp pre login ant path patterns.
     */
    DOUYIN_MINIAPP_SESSION("/login/session/douyin");


    private final String pattern;

    LoginAntPathPatterns(String pattern) {
        this.pattern = pattern;
    }

    /**
     * Pattern string.
     *
     * @return the string
     */
    public String pattern() {
        return pattern;
    }
}
